package lee.android.factory;

import lee.base.structure.BoundingBox;
import android.content.Context;
import android.graphics.Bitmap;
import android.widget.AbsoluteLayout;
import android.widget.ImageButton;

public class ButtonFactory {
	
	@SuppressWarnings("deprecation")
	public static ImageButton getImageButton(String filePathImg, Context main, BoundingBox bbox) {
		ImageButton iButton = new ImageButton(main);
		Bitmap bitmap = ImageFactory.getBitmap(filePathImg, bbox.width, bbox.height);
		iButton.setImageBitmap(bitmap);
		iButton.setBackgroundColor(0);
		iButton.setLayoutParams(new AbsoluteLayout.LayoutParams(bbox.width, bbox.height, bbox.posX, bbox.posY));
		return iButton;
	}
}
